<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>检测报告-详细报告</title>
    <style type="text/css">
        a.red:link {
            color: #FF0000
        }

        a.red:visited {
            color: #FF0000
        }

        a.red:hover {
            color: #000000
        }

        a.red:active {
            color: #FF5327
        }

        a.orange:link {
            color: orange;
        }

        a.orange:visited {
            color: orange;
        }

        a.orange:hover {
            color: #000000
        }

        a.orange:active {
            color: #FF5327
        }

        body {
            overflow-y: scroll;
            overflow-x: hidden;
        }

        p {
            margin-bottom: 1px;
        }
    </style>
    <link rel="stylesheet" href="css/paper.css">
    <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body style="OVERFLOW:SCROLL;">
<div class="layui-bg-gray" style="padding: 3%;">
    <div class="layui-row layui-col-space16">
        <div class="layui-col-md12">
            <div class="layui-panel">
                <div id="paper-content"
                     style="margin: 5% 5% 5% 5%;height: 100%;min-height:1000px; max-width: 100%">
                </div>
            </div>
        </div>
    </div>
</div>
<div class="zhengwencenter">
    <p>
        检测报告由SameReport文献相似度检测系统生成
    </p>
    <p>
        Copyright © 2007-2024 SameReport
    </p>
</div>
<div style="height:200px;background-color: #FAFAFA;color: #FAFAFA"></div>

<div class="paragraph-edit" id="paragraph-edit-content" style="display: none">
    <div class="paragraph-edit edit-erea">
        <div class="paragraph-edit edit-erea origin-sentence">
            <div class="paragraph-edit edit-erea origin-sentence label">
                原&nbsp;句
            </div>
            <div class="paragraph-edit edit-erea origin-sentence content" id="origin-sentence-content">
            </div>
        </div>
        <div style="float:left;width: 1px;height: 300px; background: #D3D4D3;"></div>
        <div class="paragraph-edit edit-erea edit-form">
            <div class="paragraph-edit edit-erea edit-form label">
                修&nbsp;改
            </div>
            <div class="paragraph-edit edit-erea edit-form content">
                <textarea style="width: 380px;height: 100%;font-size:14px;padding:10px;color: #333333"
                          id="edit-content"></textarea>
            </div>
        </div>
    </div>
    <div class="paragraph-edit tips">
        注：修改完本段落后，点击“临时保存”，修改后的内容可在“修改对照”页面中查看。
        本功能受系统环境影响，无法永久保存修改内容，请尽快将修改后的文章保存到您的论文中。
    </div>
</div>
<script type="application/javascript" src="js/jquery.min.js"></script>
<script type='text/template' id="paragraph-index-template">
    <div class="section_edit ">
        <span class="section_num ">{{index}}</span>
        <div class="edit_icon" onclick="">
            <img style="width: 16px;height: 16px" src="images/bianji.png" alt=""/>
        </div>
    </div>
</script>
<script src="../layui/layui.js"></script>
<script src="js/data.js"></script>
<script type="application/javascript" src="js/mustache.min.js"></script>
<script type="application/javascript">
    layui.use(['dropdown', 'util', 'layer'], function () {
        var element = layui.element;
        var layer = layui.layer;

        //监听折叠
        element.on('collapse(test)', function (data) {
            layer.msg('展开状态：' + data.show);
        });
    });
</script>
<script>
    let pNode = []
    sentences.forEach((currentValue, index, arr) => {
        let currentNode = currentValue;
        let parent_path = currentValue.path.split('-' + currentValue.node + '_' + currentValue.index)[0];
        if (pNode.indexOf(parent_path) === -1) {
            pNode.push(parent_path)
            let paragraphNode = document.createElement('p');
            paragraphNode.setAttribute('id', parent_path);
            document.getElementById('paper-content').appendChild(paragraphNode);
        }
        if (currentNode.is_similar !== 0) {
            let color = 'red';
            if (currentNode.is_similar === 2) {
                color = 'orange';
            }
            let sentenceNode = document.createElement('a');
            sentenceNode.setAttribute('href', "SimilarContent.html?index=" + currentNode.sentence_id.toString());
            sentenceNode.setAttribute('class', color);
            sentenceNode.setAttribute('style', 'word-wrap:break-word');
            sentenceNode.setAttribute('data-id', currentNode.sentence_id.toString());
            sentenceNode.innerText = currentNode.content;
            document.getElementById(parent_path).appendChild(sentenceNode);
        }else{
            let sentenceNode = document.createElement('span');
            sentenceNode.setAttribute('style', 'word-wrap:break-word;color: green');
            sentenceNode.innerText = currentNode.content;
            document.getElementById(parent_path).appendChild(sentenceNode);
        }

    })
    // paper.forEach((currentValue, index, arr) => {
    //     let paragraph = currentValue
    //     let dom = document.createElement('p')
    //     let sentences = []
    //     sentences.push('<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>')
    //     paragraph.sentence.forEach(sentence => {
    //         if (sentence.similar === 1) {
    //             let html = "<a href='SimilarContent.html?index=" + sentence.index + "' class='red' style='word-wrap:break-word' data-id=" + sentence.index + ">" + sentence.context + "</a>";
    //             sentences.push(html)
    //         }
    //         if (sentence.similar === 2) {
    //             let html = "<a href='SimilarContent.html?index=" + sentence.index + "' class='orange' style='word-wrap:break-word' data-id=" + sentence.index + ">" + sentence.context + "</a>";
    //             sentences.push(html)
    //         }
    //         if (sentence.similar === 0) {
    //             let html = "<span style='word-wrap:break-word;color: green'>" + sentence.context + "</span>";
    //             sentences.push(html)
    //         }
    //     })
    //     dom.innerHTML = sentences.join('')
    //     let paragrph_index_dom = document.createElement('div')
    //     let paragrph_index_template = document.getElementById("paragraph-index-template").innerHTML;
    //     view = Mustache.render(paragrph_index_template, {'index': index + 1});
    //     paragrph_index_dom.innerHTML = view
    //     document.getElementById('paper-content').appendChild(paragrph_index_dom);
    //     document.getElementById('paper-content').appendChild(dom);
    // })
</script>
</body>
</html>
